using System.Collections.Generic;

public class Table_CharModelItem : IDataItem
{
	/// <summary>
	/// 唯一ID
	/// <summary>
	public int Id { get; private set; }
	/// <summary>
	/// 名称
	/// <summary>
	public string Name { get; private set; }
	/// <summary>
	/// 资源路径
	/// <summary>
	public string ResPath { get; private set; }
	/// <summary>
	/// 动作路径
	/// <summary>
	public string AnimPath { get; private set; }
	/// <summary>
	/// 头像
	/// <summary>
	public string HeadPic { get; private set; }
	/// <summary>
	/// 头顶信息板高度修正
	/// <summary>
	public int HeadInfoHeight { get; private set; }
	/// <summary>
	/// 缩放比例
	/// <summary>
	public int Scale { get; private set; }
	/// <summary>
	/// 死亡音效
	/// <summary>
	public int DeadSound { get; private set; }
	/// <summary>
	/// 骨骼模型类别
	/// <summary>
	public int ModelType { get; private set; }

	public Table_CharModelItem(ExcelLineReader reader)
	{
		Id = reader.ReadInt();
		Name = reader.ReadString();
		ResPath = reader.ReadString();
		AnimPath = reader.ReadString();
		HeadPic = reader.ReadString();
		HeadInfoHeight = reader.ReadInt();
		Scale = reader.ReadInt();
		DeadSound = reader.ReadInt();
		ModelType = reader.ReadInt();
	}
}

public class Table_CharModelMgr : IDataMgr
{
	protected override string FileName { get { return "Txt/CharModel.txt"; } }

	protected Dictionary<int, int> mItemDic = new Dictionary<int, int>();
	public int GetIdxById(int key) { return mItemDic[key]; }

	public override void Load(ExcelLineReader reader)
	{
		var item = new Table_CharModelItem(reader);
		mItemDic[item.Id] = DataCount;
		mItemList.Add(item);
	}

	public Table_CharModelItem GetItemByIdx(int idx)
	{
		return GetItemByIdx<Table_CharModelItem>(idx);
	}

	public Table_CharModelItem GetItemById(int id)
	{
		int idx = GetIdxById(id);
		return GetItemByIdx(idx);
	}
}